﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class follow : MonoBehaviour
{
    public GameObject rocket;
    public Vector3 distance;
    public bool canFollow = false;
    // Start is called before the first frame update
    void Start()
    {
        distance = transform.position - rocket.transform.position;
    }


    private Vector3 old;
    private Vector3 next;
    // Update is called once per frame
    void LateUpdate()
    {
        if (canFollow)
            transform.position = new Vector3((rocket.transform.position + distance).x, (rocket.transform.position + distance).y, transform.position.z);
    }
}
